package com.mipo.automic;


public class TestReg {
	public static int i = 0;
	public static volatile int count = 0;

	public static void main(String[] args) {
		for (int j = 0; j < 10; j++) {
			new MyThread().start();
		}
		while (count != 10);
		System.out.println(i);
	}

	public static class MyThread extends Thread {

		@Override
		public void run() {
			for (int j = 0; j < 10000; j++) {
				i++;
			}
			++count;
		}
		
	}
}
